package com.naiterui.ehp.bs.doctor.fegin;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import com.naiterui.ehp.bp.bo.form.DesignFormBO;
import com.naiterui.ehp.bp.bo.form.FormConfBO;
import com.naiterui.ehp.bp.support.config.FeignConfiguration;
import com.naiterui.ehp.bp.support.exception.BusinessException;

/**
 * @author yangfuya
 * @since 2022/1/5
 */
@RequestMapping("inner")
@FeignClient(name = "designFrom", url = "${ehp.domain.form}", configuration = FeignConfiguration.class)
public interface DesignFormFeignClient {

    /**
     * 设计表单保存
     */
    @PostMapping("/design")
    String formDesign(@RequestBody FormConfBO formConfBO) throws BusinessException;

    /**
     * 获取设计表单
     * 
     * @param formId
     * @return
     * @throws BusinessException
     */
    @GetMapping("/design/{formId}")
    DesignFormBO getDesignForm(@PathVariable("formId") String formId) throws BusinessException;

    /**
     * 获取表单设计和数据
     *
     * @param formId
     * @param businessId
     * @return
     * @throws BusinessException
     */
    @GetMapping("/design/data/{formId}/{businessId}")
    DesignFormBO getDesignFormDataVO(@PathVariable("formId") String formId,
        @PathVariable("businessId") String businessId) throws BusinessException;

    /**
     * 复制设计表单
     *
     * @param formId
     * @return
     * @throws BusinessException
     */
    @GetMapping("/design/copy/{formId}")
    String copyDesignForm(@PathVariable("formId") String formId) throws BusinessException;

}
